<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\UserDrugWarehouse */

$this->title = "用户药品仓库详情";
$this->params['breadcrumbs'][] = ['label' => 'User Drug Warehouses', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-drug-warehouse-view">

    <br>
    <p>
        <?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => '确定要删除吗?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            [
                'attribute'=>'user_id',
                'value'=>$model->user->name,
            ],
            [
                'attribute'=>'user_drug_id',
                'value'=>$model->userDrug->name,
            ],
            [
                'attribute'=>'user_supplier_id',
                'value'=>$model->userSupplier->name,
            ],
            'num',
            'in_price',
            'out_price',
            'vip_price',
            'product_coding',
            'produce_time',
            'expired_time',
            [
                'attribute'=>'status',
                'value'=>function($data){
                    return $data->status == 1 ? '已显示' : '不显示';
                }
            ],
        ],

    ]) ?>

</div>
